<%--
  Created by IntelliJ IDEA.
  User: 28689
  Date: 2022/3/13
  Time: 17:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="layuimini-main">

    <div class="layui-form layuimini-form" lay-filter="yingtingproductFrom">
        <div class="layui-form-item">
            <label class="layui-form-label required">影厅名称</label>
            <div class="layui-input-block">
                <input type="hidden" name="id" >
                <input type="text" name="name" lay-verify="required" lay-reqtext="影厅名不能为空" placeholder="请输入影厅名" value="" class="layui-input">

            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">列</label>
            <div class="layui-input-block">
                <input type="text" name="row" lay-verify="required" lay-reqtext="排不能为空" placeholder="请输入排" value="" class="layui-input">

            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">排</label>
            <div class="layui-input-block">
                <input type="text" name="line" lay-verify="required" lay-reqtext="列不能为空" placeholder="请输入列" value="" class="layui-input">

            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label required">座位号</label>
            <div class="layui-input-block">
                <input type="text" name="seat" lay-verify="required" lay-reqtext="座位号不能为空" placeholder="请输入座位号" value="" class="layui-input">

            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['form', 'table'], function () {
        var form = layui.form,
            layer = layui.layer,
            table = layui.table,
            $ = layui.$;

        /**
         * 初始化表单，要加上，不然刷新部分组件可能会不加载
         */
        form.render();

        // 当前弹出层，防止ID被覆盖
        var parentIndex = layer.index;

        //监听提交
        form.on('submit(saveBtn)', function (data) {
            console.info(data);
            $.post("fangyingting/saveOrUpdate.do",data.field,function (data) {
                if (data.success){
                    layer.close(parentIndex);
                    table.reload("currentTableId");

                }else{
                    layer.msg(error);

                }
            })



            return false;
        });

    });
</script>
